<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>关联企业</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
	<form id="cust_cst_corp_rl_comp_form">
            <div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
                <div class="fieldBox col_50">
                    <div class="label">关系</div>
                    <div class="field">
                        
                        <span id="rlTypCdNm" name="rlTypCdNm"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">企业名称</div>
                    <div class="field">
                        <span id="compNm" name="compNm"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">法人代表</div>
                    <div class="field">
                       <span id="corpRep" name="corpRep"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">联系方式</div>
                    <div class="field">
                        <span id="tel" name="tel"></span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">单位地址</div>
                    <div class="field">
                    	<span id="addr" name="addr"></span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">备注</div>
                    <div class="field" style="width: 100%;">
                    	<span id="rlRem" name="rlRem"></span>
                    </div>
                </div>
                <!-- hide data -->
		        <div class="fieldBox col_100" style="display:none;">
		          <div class="field">
		              <input name="crcId" id="crcId" type="text" class="ui-textbox" value="${crcId}">
		          </div>
		        </div>
            </div>
        </form>
        <script>
		$(function() {
		   $("#cust_cst_corp_rl_comp_form").ligerForm({
                validate: true
           });
	       initData();
		});
		
		frameElement.dialog.onCancel = function () {
			frameElement.dialog.close();
		}
		
		function initData(){
			var crcId = $("#crcId").val();
	    	if(!crcId)return;
	    	var wait_dialog= $.ligerDialog.SQalert({
	            content: LogUtils.LOG_CMM_LOADING,
	            SQ_type: "waitting",
	            onClose: function () {
	            }
	        });

	    	var _url = '<%=path%>/customer/cstcorprlcomp/getById.do?isEncrypt=1';
	    	$.ajax({
	    		type: 'get',
	    		dataType:'json',
	    		data:{id:crcId},
	    		url: _url,
	    		success:function(msg){
	    			wait_dialog.close();
	    			 if(msg.success == 1){
	    				 setData(msg.data);//设置数据
	    			 }else{
	    				 $.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	    			 }
	    		}
	    	});
    	}
		
		//设置页面数据
	     function setData(data){
	    	$("#rlTypCdNm").html(data.rlTypCdNm);
	    	$("#compNm").html(data.compNm);
	    	$("#tel").html(data.tel);
	    	$("#rlRem").html(data.rlRem);
	    	$("#corpRep").html(data.corpRep);
	    	$("#addr").html(data.addr);
		}; 
	</script>
</body>
</html>